package helloWorld;

import json.Mapper;
import command.StatechartCommand;
import command.menu.project.CreateProjectCommand;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String str = null;
		try {
			StatechartCommand command = new CreateProjectCommand("nom",
					"nom_projet", "description");
			//str = Mapper.getObjectMapper().writeValueAsString(command);
			str = command.getContentAsString();
			System.out.println(str);
		} catch (Exception e) {
			System.err.println("parsing failed");
			e.printStackTrace();
		}

		try {
			StatechartCommand command = Mapper.getObjectMapper().readValue(str, StatechartCommand.class);
			
			System.out.println(command);
			
			System.out.println(command instanceof CreateProjectCommand);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
